<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--潘天赐-->
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-treeview.min.css"
          th:href="@{static/js/bootstrap/css/bootstrap-treeview.min.css}"
    >
    <script src="static/js/bootstrap/js/bootstrap-treeview.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.addtabs.css">
    <script src="static/js/bootstrap/js/bootstrap.addtabs.min.js"></script>
    <link rel="stylesheet" href="static//js/bootstrap/css/bootstrap-table.min.css">
    <script src="static/js/bootstrap/js/bootstrap-table.min.js"></script>
    <script src="static/js/bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="static/js/bootstrap/js/bootbox.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="static/js/bootstrap-fileinput/js/fileinput.js"></script>
    <script src="static/js/bootstrap-fileinput/js/locales/zh.js"></script>
    <link rel="stylesheet" href="static/js/bootstrap-fileinput/css/fileinput.css">

</head>
<body>
<table class="table">
    <tr>
        <td>项目名称：<span style="color: #8c8c8c" id="productName"></span></td>
        <td>采购方名称：<span style="color: #8c8c8c" id="userName"></span></td>
        <td>类目：<span style="color: #8c8c8c" id="materialsType"></span></td>
        <td></td>
    </tr>
    <tr>
        <td>项目编码：<span style="color: #8c8c8c" id="productId"></span></td>
        <td>开始时间：<span style="color: #8c8c8c" id="queryPriceStartDate"></span></td>
        <td>报价截止时间：<span style="color: #8c8c8c" id="queryPriceEndDate"></span></td>
        <td>期望收货周期（天）：<span style="color: #8c8c8c" id="receiveGoodsDay"></span></td>
    </tr>
</table>
<h4 style="color: #2b669a">选中供应商</h4>
<table class="table">
    <tr>
        <td>供应商名称：<span style="color: #8c8c8c" id="userRealName"></span></td>
        <td>联系人：<span style="color: #8c8c8c" id="userRealNameTo"></span></td>
        <td>类型方式：<span style="color: #8c8c8c" id="userPhone"></span></td>
        <td>报价有效期（天）：<span style="color: #8c8c8c" id="offerFormValidTime"></span></td>
    </tr>
</table>
<table class="table">
    <tr style="color: #8c8c8c">
        <th>订单id</th>
        <th>下单时间</th>
        <th>完成时间</th>
        <th>订单总额</th>
        <th>支付方式</th>
        <th>订单状态</th>
    </tr>
    <tr style="color: #8c8c8c">
        <td><span id="order_id"></span></td>
        <td><span id="order_start_time"></span></td>
        <td><span id="order_end_time"></span></td>
        <td><span id="order_price"></span></td>
        <td><span id="order_pay_type"></span></td>
        <td><span id="order_state"></span></td>
    </tr>
</table>
<!--主表Id-->
<input id="span1" th:type="hidden" th:value="${id.queryPriceId}">
</body>
<script>
$(function (){
    find();
})
/*主表Id*/
var id = $("#span1").val()
function find() {
    $.ajax({
        url:"findByOrder",
        type:"post",
        data:{id:id},
        success:function(data){
            var productName = document.getElementById("productName");
            productName.innerHTML+=data.productName;
            var userName = document.getElementById("userName");
            userName.innerHTML+=data.userName;
            var materialsType = document.getElementById("materialsType");
            if (data.materialsType==1){
                materialsType.innerHTML+="阀门";
            }else if (data.materialsType==2){
                materialsType.innerHTML+="球阀";
            }else if (data.materialsType==3){
                materialsType.innerHTML+="仪器仪表";
            }else if (data.materialsType==4){
                materialsType.innerHTML+="一次性仪器仪表";
            }
            var productId = document.getElementById("productId");
            productId.innerHTML+=data.productId;
            var queryPriceStartDate = document.getElementById("queryPriceStartDate");
            queryPriceStartDate.innerHTML+=data.queryPriceStartDate;
            var queryPriceEndDate = document.getElementById("queryPriceEndDate");
            queryPriceEndDate.innerHTML+=data.queryPriceEndDate;
            var receiveGoodsDay = document.getElementById("receiveGoodsDay");
            receiveGoodsDay.innerHTML+=data.receiveGoodsDay;
            var userRealName = document.getElementById("userRealName");
            userRealName.innerHTML+=data.userRealName;
            var userRealNameTo = document.getElementById("userRealNameTo");
            userRealNameTo.innerHTML+=data.userRealNameTo;
            var userPhone = document.getElementById("userPhone");
            userPhone.innerHTML+=data.userPhone;
            var offerFormValidTime = document.getElementById("offerFormValidTime");
            offerFormValidTime.innerHTML+=data.offerFormValidTime;
            var order_id = document.getElementById("order_id");
            order_id.innerHTML+=data.order_id;
            var order_start_time = document.getElementById("order_start_time");
            order_start_time.innerHTML+=data.order_start_time;
            var order_end_time = document.getElementById("order_end_time");
            order_end_time.innerHTML+=data.order_end_time;
            var order_price = document.getElementById("order_price");
            order_price.innerHTML+=data.order_price;
            var order_pay_type = document.getElementById("order_pay_type");
            order_pay_type.innerHTML+=data.order_pay_type;
            var order_state = document.getElementById("order_state");
            if (data.order_state==1){
                order_state.innerHTML+="未支付";
            }else if (data.order_state==2){
                order_state.innerHTML+="已支付";
            }
        }
    });
}

</script>
</html>